package com.mp.entity;

import com.baomidou.mybatisplus.annotation.SqlCondition;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.time.LocalDateTime;

@EqualsAndHashCode(callSuper = false)
@Data
//@TableName("mp_user")
public class User extends Model<User> {

    // 如果表中不是默认id,这块需要设置字段作为表中ID
    @TableId
    private Long id;
    // 指定对应表中的名称
    @TableField(value = "name",condition = SqlCondition.LIKE)
    private String realName;

    private Integer age;

    private String email;

    private Long managerId;

    private LocalDateTime createTime;

    // 不在表中对应任何字段，不参与映射，默认exist = true 参与映射
    @TableField(exist = false)
    private String remark;

}
